<!DOCTYPE html>
<html>
<head>
  <#assign dicSelect=JspTaglibs["http://www.casic304.cn/dicSelect"] />
  <#assign secSelect=JspTaglibs["http://www.casic304.cn/secSelect"] />
  <#assign fillDept=JspTaglibs["http://www.casic304.cn/fillDept"] />
    <meta charset="utf-8">
    <title>产品证明书信息</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="${ctx}/layui/css/layui.css" media="all"/>
    <link rel="stylesheet" href="${ctx}/qbdmsStatic/iconfont/iconfont.css"/>
    <link rel="stylesheet" href="${ctx}/qbdmsStatic/style/qbdms.css">
    <script type="text/javascript">
        var __ctx = "${ctx}";
    </script>
</head>
<body class="listBody qbdms-particulars">
<div class="qbdms-bodyDiv">
    <div class="layui-table-view-body qbdms-add-view-body">
        <div class="qbdms-formTitle">产品证明书信息 <i class="qbdms-returnOn closeWindow">返回</i></div>
        <form class="layui-form formPreview" requrl="${ctx}/qbdms/wQbdProductCertificateInfo/get" lay-filter="wQbdProductCertificateInfoDataForm">
            <div class="" style="width: 100%;">
                <table class="tableExcel qbdms-zeroTable" width="100%" border="0" cellspacing="0" cellpadding="0">
                    <tbody>
                    <tr id="tbxx"></tr>
                    <tr>
                      <td class="qbdms-zeroTable-lable">密级<span style="color: red;">*</span></td>
                      <td colspan="5"><@secSelect.sec_select data_src=1 required=true name="secret"/></td>
                    </tr>
                    <tr>
                      <td class="qbdms-zeroTable-lable">编号<span style="color: red;">*</span></td>
                      <td colspan="5" name="serialNumber"></td>
                    </tr>
                    <tr>
                      <td class="qbdms-zeroTable-lable">型号<span style="color: red;">*</span></td>
                      <td colspan="5" name="modelsymbol"></td>
                    </tr>
                    <tr>
                      <td class="qbdms-zeroTable-lable">产品名称<span style="color: red;">*</span></td>
                      <td colspan="5" name="productName"></td>
                    </tr>
                    <tr>
                      <td class="qbdms-zeroTable-lable">产品代号<span style="color: red;">*</span></td>
                      <td colspan="5" name="productCode"></td>
                    </tr>
                    <tr>
                      <td class="qbdms-zeroTable-lable">出厂编号<span style="color: red;">*</span></td>
                      <td colspan="5" name="factoryNumber"></td>
                    </tr>
                    <tr>
                      <td class="qbdms-zeroTable-lable">出厂日期<span style="color: red;">*</span></td>
                      <td colspan="5" name="factoryTime"></td>
                    </tr>
                    <tr>
                      <td class="qbdms-zeroTable-lable">检验员<span style="color: red;">*</span></td>
                      <td colspan="5" name="inspectorsName"></td>
                    </tr>
                    <tr>
                      <td class="qbdms-zeroTable-lable">产品证明书上传</td>
                      <td colspan="5"><div class="uploadFileList" fileUploadName="emergencyReleaseFormFile" ></div></td>
                    </tr>
                    </tbody>
                </table>
                            <input name="factoryTime" type="hidden" placeholder="未填写" autocomplete="off" class="layui-input dateTimeFiled input-right time-init" format="yyyy-MM-dd" datetype="date" />
                            <input name="createTime" type="hidden" placeholder="未填写" autocomplete="off" class="layui-input dateTimeFiled input-right time-init" format="yyyy-MM-dd" datetype="date" />
                            <input name="updateTime" type="hidden" placeholder="未填写" autocomplete="off" class="layui-input dateTimeFiled input-right time-init" format="yyyy-MM-dd" datetype="date" />
            </div>
            <div class="layui-form-item btnformItem">
                <p>
                    <button type="reset" id="closeWindow" class="layui-btn layui-btn-sm btn-save qbdms-oneBtnLine">返回</button>
                </p>
            </div>
        </form>
    </div>
</div>
<script src="${ctx}/qbdmsStatic/public/configFile.js"></script>
<script src="${ctx}/layui/layui.js"></script>
<script>
    layui.config({
        base: serverPath.qbdmsPath + staticPath.qbdmsPath //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index', 'setter', 'layer', 'propsHandle', 'upload', 'common', 'laydate', 'jquery', 'publicMethods', 'qbdmsForm'], function () {
        // -----常量声明----------
        var $ = layui.jquery,
            laydate = layui.laydate,
            setter = layui.setter,  // 配置信息
            layer = layui.layer,
            common = layui.common,
            propsHandle = layui.propsHandle,
            upload = layui.upload,
            publicMethods = layui.publicMethods,
            formId = '' || '',
            form = layui.qbdmsForm;
        $(".subContTem").hide()

        var defProps = {
            //viewMould: 'form/formDef/view/formDesign/moulds/', // 组件模块 存放文件 *****
            viewMould: 'moulds/', // 组件模块 存放文件 *****
            selectorBtn: '.selectorBtn'
        };
        var temQuery = new propsHandle();  // 实例化模板功能部分
        temQuery.initTem({
            selectorBtn: defProps.selectorBtn,
            selectorTemPath: setter.views + defProps.viewMould
        });

        var dateTimeFiledLen = $(".dateTimeFiled");
        for (var i = 0; i < dateTimeFiledLen.length; i++) {
            laydate.render({
                elem: dateTimeFiledLen[i] //指定元素
                , type: 'date'
                , trigger: 'click'
            });
        }
        //关闭当前页面
        //关闭当前页面
        $("#closeWindow,.closeWindow").click(function () {
            window.location.href ='${ctx}/qbdms/wQbdProductCertificateInfo/view/list';
        });

        var runId = "${runId}";
        if (runId == null || runId == '') {
            $("#hideAndShow").show();
        }

        var common = layui.common;
        common.updateForm({
            name: 'wQbdProductCertificateInfoDataForm',
            idValue: "${id}",
            primary: "id",
          getCallback: function (data) {
            $("#tbxx").html("<td class='qbdms-zeroTable-lable'>填报信息:</td><td colspan='5' class=''>【" + data.data.filldept + " | " + data.data.fillman + " | " + data.data.filldate + "】</td>");

            $("input[name='inspectorsName']").attr("ids", data.data.inspectorsId);

            //-修改页面 初始化附件组件 开始 ------------------------------------------
            $('.uploadFileList').each(function () {
              var fileUploadName = $(this).attr("fileUploadName");
              var jsonFile = data.data[fileUploadName];
              var files = eval(jsonFile);

              if (files) {
                for (var i = 0; i < files.length; i++) {
                  var fileLevel = files[i].fileLevel;
                  var fileLevelText = files[i].fileLevelText;
                  var fileSec = '<div class="fileSecLevel fileSecXg layui-input-inline">' + '<@secSelect.sec_select data_src=1 hasBlank=false/>' + "</div>";
                  var newStr = '<span class="file-id" style="margin-right: 20px;" fileId=' + files[i].fileId + ' fileLevelText="' + fileLevelText + '">' + fileSec + '<span class="file-name" title="点击下载文件" onclick="downFile(this)"><i class="iconfont" style="margin-right: 5px"></i>' + files[i].fileName + '</span></span>';
                  $(this).html(newStr);
                  $(this).find("select:last").val(fileLevel);
                  $(this).find("select:last").attr("disabled", "disabled");
                }
              } else {
                $(this).html("<span style='color: #c0c4cc'>未上传</span>");
              }
            });
            //-修改页面 初始化附件组件 结束 ------------------------------------------
          }
        });
      //下载附件
      window.downFile = function (obj) {
        var fileId = $(obj).parents("span").attr("fileId");
        window.location.href = serverPath.qbdmsPath + setter.extendLinkPath + "attachFile/download?fileId=" + fileId;
      }

      publicMethods.bottomFixd()
      $("body *").not("#closeWindow").attr("disabled", "disabled");
      $(".uploadFileCont .qbdms-fileUp,.uploadFileCont i,.addFormTr1").hide();
      $(".uploadFileCont").each(function () {
        if ($(this).children('.uploadFileList').children().length == 0) {
          $(this).children('.uploadFileList').append("<span style='color: #C0C4CC'>未上传</span>")
        }
      })

    });
</script>
</body>
</html>